<template>
  <div class="personal-exam p-d">
    <div class="p-d b-f m-b">
      <SearchComp :searchForm="searchForm" :searchData="queryString" :searchAction="searchAction"></SearchComp>
    </div>
    <div class="p-d b-f">
      <div>
        <el-button type="primary">新增</el-button>
        <el-button type="warning">导入</el-button>
        <el-button type="warning">导出</el-button>
        <el-button type="danger">批量删除</el-button>
      </div>
      <TableCompEle class="m-t" ref="multipleTable" :tableData="tableData" :tableConfig="tableConfig" :tableAction="tableAction" :isSelect="true"
        :isIndex="true" :isShowPage="true" :queryParams="queryParams" @getPagination="getList" @handleSelectionChange="handleSelectionChange">
      </TableCompEle>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      queryParams: {
        total: 5,
        currentPage: 1,
        pageSize: 10
      },
      queryString: {
        title: '',
        source: ''
      },
      searchForm: {
        changeMethod: () => {
          this.queryParams.currentPage = 1
        },
        formData: [
          {
            type: 'Input',
            label: '题库名称',
            prop: 'title',
            clearable: true,
            icon: 'el-icon-search',
            placeholder: '请输入标题'
          },
        ]
      },
      searchAction: [
        {
          label: '查询',
          type: 'primary',
          handle: () => {
            this.queryParams.currentPage = 1
            this.$refs.multipleTable.clearSelection()
          }
        },
        {
          label: '重置',
          type: 'primary',
          plain: true,
          handle: () => {
            this.queryString = {
              title: '',
              source: ''
            }
            this.queryParams.currentPage = 1
          }
        }
      ],
      tableData: [
        {
          name: '设施仪器使用题库',
          name2: '1587622451624120321',
          name3: '20',
          name4: '10',
          name5: '30',
        },
        {
          name: '设施仪器使用题库',
          name2: '1587622451624120321',
          name3: '20',
          name4: '10',
          name5: '30',
        },
        {
          name: '设施仪器使用题库',
          name2: '1587622451624120321',
          name3: '20',
          name4: '10',
          name5: '30',
        },
        {
          name: '设施仪器使用题库',
          name2: '1587622451624120321',
          name3: '20',
          name4: '10',
          name5: '30',
        },
        {
          name: '设施仪器使用题库',
          name2: '1587622451624120321',
          name3: '20',
          name4: '10',
          name5: '30',
        },
      ],
      tableConfig: [
        {
          prop: 'name',
          label: '题库名称'
        },
        {
          prop: 'name2',
          label: '题库ID'
        },
        {
          prop: 'name3',
          label: '单选题数量'
        },
        {
          prop: 'name4',
          label: '多选题数量'
        },
        {
          prop: 'name5',
          label: '判断题数量'
        },
      ],
      tableAction: {
        align: () => 'center',
        width: () => String(190),
        operations: [
          {
            label: '查看',
            isLink: true,
            type: 'primary',
            method: () => {
            }
          },
          {
            label: '修改',
            isLink: true,
            type: 'primary',
            method: () => {
            }
          },
          {
            label: '删除',
            isLink: true,
            type: 'danger',
            method: () => {
            }
          },
        ]
      },
    }
  },
}
</script>

<style lang="less" scoped>
</style>